# Maintainer:
pkgname=py3-pyscreeze
pkgver=0.1.29
# no actual tags
_gitrev=2cf06466855260fb20982a813957e9452ce45c11
pkgrel=3
pkgdesc="Simple, cross-platform screenshot module for Python 2 and 3"
url="https://github.com/asweigart/pyscreeze"
arch="noarch"
license="GPL-3.0-or-later"
depends="python3 py3-pillow py3-xlib scrot"
makedepends="py3-setuptools py3-gpep517"
checkdepends="xvfb-run"
subpackages="$pkgname-pyc"
source="$pkgname-$_gitrev.tar.gz::https://github.com/asweigart/pyscreeze/archive/$_gitrev.tar.gz"
builddir="$srcdir/pyscreeze-$_gitrev"

build() {
	gpep517 build-wheel \
		--wheel-dir .dist \
		--output-fd 3 3>&1 >&2
}

check() {
	python3 -m venv --clear --without-pip --system-site-packages .testenv
	gpep517 install-wheel --destdir .testenv --prefix '' .dist/*.whl
	xvfb-run -a .testenv/bin/python3 tests/test_pyscreeze.py
}

package() {
	gpep517 install-wheel --destdir "$pkgdir" \
		.dist/*.whl
}
sha512sums="
cedf02941a0c3ba7018bb732de3c11206a0a88badd0531e78d0a636abf53df8bea15497205954ed2ef9d66eeff15ea263b6d7e34f4f103fe6542010de931fa32  py3-pyscreeze-2cf06466855260fb20982a813957e9452ce45c11.tar.gz
"
